import {
	request
} from '@/utils/request.js';

// 账号密码登录
export const passwordLogin = (data) => {
	return request({
		method: 'post',
		url: '/auth/login',
		data,
	})
}

// 获取验证码
export const getVerificationCode = (data) => {
	return request({
		method: 'get',
		url: '/system/cdb/user/sendLoginSMS',
		data,
	})
}

// 验证码登录
export const codeLogin = (data) => {
	return request({
		method: 'post',
		url: '/auth/login',
		data,
	})
}

// 退出登录
export const logout = () => {
	return request({
		method: 'post',
		url: '/auth/logout',
	})
}

// 修改密码
export const changePassword = (data) => {
	return request({
		method: 'post',
		url: '/system/direct/user/password/update',
		data,
	})
}

// 修改手机号
export const changePhone = (data) => {
	return request({
		method: 'post',
		url: '/system/direct/user/phone/update',
		data,
	})
}

// 获取用户信息
export const getUserInfo = () => {
	return request({
		method: 'get',
		url: '/system/direct/user/detail',
	})
}